<!-- <!DOCTYPE html> -->
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/detail.css">
</head>
<body>
    <div class="header1">商品详情页
        <a href="./list.html">回到列表页</a>
    </div>
    <div class="center1">
        <div class="imgs">
            <img src="" alt="">
        </div>
        <div class="text"> 
            <p class="p1"></p>
            <p class="p2"></p>
            <p class="p3"></p>
            <p class="p4"></p>
        </div>
    </div>
    <div class="nn">
        <img src="" alt="" class="img1">
    </div>
    <script src="../lib//axios.min.js"></script>
    <script src="../lib/http.js"></script>fb
    <script>
        let center=document.querySelector('.center1')
        let img=document.querySelector('img')
        let text=document.querySelector('.text')
        let P=document.querySelectorAll('p')
        let nn=document.querySelector('.nn')
        async function fn3(se) {
            let id=localStorage.getItem('goods_id')
            let htmls=``
            let {data}=await http.get('/goods/item',{params:{id}});
            // let res=await http.get('/goods/item',{params:{id}});
            // console.log(res)
            htmls=`
            <div class="imgs">
            <img src="${data.info.img_big_logo}" alt="">
        </div>
        <div class="text"> 
            <p class="p1">${data.info.title}</p>
            <p class="p2">原价：¥${data.info.price}</p>
            <p class="p3">折扣：${data.info.sale_type*10}折</p>
            <p class="p4">现价：¥${data.info.current_price}</p>
        </div>
            `
            html1=`
            <img src="${data.info.goods_introduce}">
            `
            nn.innerHTML=html1
            center.innerHTML=htmls
            console.log(data)
            console.log(data.info.sale_type)
            localStorage.removeItem('goods_id')
        }
        fn3()
        
    </script>
</body>
</html>